<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>提示</title>
    <div th:replace="cqzd/common/common-resource :: global-header"></div>
</head>
<body style="text-align:center;">
<div class="panel panel-primary">
    <div class="container">
        <div class="row">
            <div class="col-md-8">
                <form class="form-horizontal" action="">
                    <div class="form-group">
                        <div class="input-group col-md-4" id="fileId">
	                        <span class="input-group-addon">
	                            <i class="glyphicon glyphicon-search"></i>
	                        </span>
                            <input id="inputFileId" class="form-control" placeholder="请选择文件" multiple type="file" name="file">
                        </div>
                    </div>
                    <div class="form-group">
                        <div class="col-md-4">
                            <div class="btn-group btn-group-justified">
                                <div class="btn-group">
                                    <button type="button" class="btn btn-success" id="submitbtn" onclick="addDiacInfo()">
                                        <span class="glyphicon glyphicon-share"></span>&nbsp;文件上传
                                    </button>
                                </div>
                            </div>
                        </div>
                    </div>
                </form>
            </div>
        </div>
    </div>
</div>
</body>
<script>
    txkui.parse();

    function addDiacInfo() {
        var fileArray=document.querySelector('#inputFileId');
        console.log(fileArray.files);

        var formData = new FormData();
        formData.append("json",JSON.stringify(DibJson));
        // formData.append("file[0]", fileArray.files[0]);
        // formData.append("file[1]", fileArray.files[1]);
        for(var i=0,f;f=fileArray.files[i];i++){
            formData.append("file", f);
        }


        $.ajax({
            url: "cqzd/do/dibinfo/",
            data: formData,
            type: "POST",
            processData:false,
            contentType : false,
            success: function (data) {

            }
        })
    }
</script>
</html>